/**
 * 系统日志，使用winton ，日志参数设置在./winston.config.ts 文件中
 */
import { Injectable, LogLevel, LoggerService } from '@nestjs/common';
import { type Logger } from 'winston';
import logger from './winston.config';



@Injectable()
export class YhLoggerService implements LoggerService {
    private readonly logger: Logger;

    constructor() {
        this.logger = logger;
    }
    log(message: string, context: string) {
        this.logger.log('info', `${context} ${message}`);
    }
    error(message: any, context: string) {
        this.logger.log('error', `${context} ${message}`);
    }
    warn(message: any, context: string) {
        this.logger.warn('warn', `${context} ${message}`);
    }
    debug?(message: any, context: string) {
        this.logger.debug('debug', `${context} ${message}`);
    }
    verbose?(message: any, context: string) {
        throw new Error('Method not implemented.');
    }
    fatal?(message: any, context: string) {
        throw new Error('Method not implemented.');
    }
    setLogLevels?(levels: LogLevel[]) {
        throw new Error('Method not implemented.');
    }
    
    // 其他日志方法...
}